(Fwrite_region) [DOS_NT]: Remove O_TRUNC from open
authorGerd Moellmann <gerd@gnu.org>
Fri, 9 Mar 2001 12:38:54 +0000 (12:38 +0000)
committerGerd Moellmann <gerd@gnu.org>
Fri, 9 Mar 2001 12:38:54 +0000 (12:38 +0000)
flags argument to emacs_open; it seems to conflict with O_EXCL.

src/fileio.c

index dc0878739882e16b239f22c816c865a559d0c71b..fb40e549710a54d6757a4458decbd63bc5bd2e1c 100644 (file)
@@ -4684,8 +4684,8 @@ This does code conversion according to the value of\n\
 #else /* not VMS */
 #ifdef DOS_NT
   desc = emacs_open (fn,
-                    O_WRONLY | O_TRUNC | O_CREAT | buffer_file_type
-                    | (mustbenew == Qexcl ? O_EXCL : 0),
+                    O_WRONLY | O_CREAT | buffer_file_type
+                    | (EQ (mustbenew, Qexcl) ? O_EXCL : O_TRUNC),
                     S_IREAD | S_IWRITE);
 #else  /* not DOS_NT */
   desc = emacs_open (fn, O_WRONLY | O_TRUNC | O_CREAT